package com.p2p.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.p2p.common.DTO.BorrowerDTO;
import com.p2p.entity.Borrower;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface BorrowerMapper extends BaseMapper<Borrower> {

    /**
     * 分页查询借款用户信息
     * @param page 分页
     * @return
     */
    Page<BorrowerDTO> findBorrowerByPage(@Param("page") Page<BorrowerDTO> page);


    int updateBorrowerPwd(@Param("loginPwd") String loginPwd,
                      @Param("payPwd") String payPwd,
                      @Param("id") Long id);


    Page<BorrowerDTO> findBorrowerByCondition(@Param("page") Page<BorrowerDTO> page,
                                              @Param("name") String name,
                                              @Param("phone") String phone,
                                              @Param("lockStatus") Byte lockStatus);

    int deleteLoginDate(@Param("id") Long id);
}
